#ifndef INC_CERRORSTREAM_H
#define INC_CERRORSTREAM_H

#include <stdio.h>
#include <NxPhysics.h>
#include "..\Debug.h"
class CErrorStream : public NxUserOutputStream {
	
	public:
		void reportError(NxErrorCode e, const char* message, const char* file, int line) {
			printf("%s (%d) :", file, line);
			switch (e) {
				case NXE_INVALID_PARAMETER:
					printf("invalid parameter");
					break;
				case NXE_INVALID_OPERATION:
					printf("invalid operation");
					break;
				case NXE_OUT_OF_MEMORY:
					printf("out of memory");
					break;
				case NXE_DB_INFO:
					printf("info");
					break;
				case NXE_DB_WARNING:
					printf("warning");
					break;
				default:
					printf("unknown error");
			}

			printf(" : %s\n", message);
		}

		NxAssertResponse reportAssertViolation(const char* message, const char* file, int line) {
			printf("access violation : %s (%s line %d)\n", message, file, line);

			return NX_AR_BREAKPOINT;
		}

		void print(const char* message) {
			printf(message);
		}

};

#endif /* INC_CERRORSTREAM_H */
